<!DOCTYPE html>

<?php include "res/title.php"; ?>

<html>
<head>
	<title>GoDeal - <?php echo $title; ?></title>
	<meta charset="UTF-8">

	<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" type="text/css" href="/css/style.css">
	<link rel="icon" type="image/png" href="/favicon.png" />

	<script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="/js/client-script.js"></script>
</head>
<body>

	<!-- Navigation -->
	<?php include "res/navigation.php"; ?>

	<div class="wrapper">
		<!-- Categories -->
		<?php include "res/categories.php"; ?>

		<!-- Right content -->
		<?php include "res/right-content.php" ?>

		<div class="container">
			<?php if($product != 0) { ?>
			<h1><?php echo $pr[0]->name ?></h1>
			<?php } else { ?>
			<h1>Пополнение личного счета</h1>
			<?php } ?>
			<h2>Выберите способ оплаты</h2>
			<a href="/godeal/home/newBill/product/<?php echo $product ?>"><img src="/img/kassa24.gif"></a>

			<div style="display: table-cell; vertical-align: center">
				<img src="/img/Qiwi.jpg" style="height: 120px; margin-left: 28px; vertical-align:middle">
				Для пополнения счета в <b style="color: #0B6DB8">QIWI</b> <b style="color: #FE9C00">Кошелек</b> введите код <b><?= $me[0]->ID ?></b>
			</div>

			<?php if($product != 0) { ?>
			<h2>Оплата со счета</h2>
			<?php if($me[0]->account > $pr[0]->cost ) { ?>
				<form action="/godeal/home/accountBuy" method="post">
					<input type="hidden" value="<?php echo $product ?>" name="product">
					<button class="buy-button">Купить со счета</button>
				</form>	
			<?php } else { ?>
				<div class="error">Не хватает средств для оплаты</div>
			<?php } ?>
			<?php } ?>
		</div>

		<!-- Footer -->
		<?php include "res/footer.php"; ?>
	</div>

	<!-- Popup Login -->
	<?php include "res/popup-login.php" ?>
</body>
</html>